<template>
  <div class="welcome">
    <h2 class="weak">
      欢迎来到求苗服务后台
    </h2>
  </div>
</template>
<script>
  import { getLocationOrigin } from 'utils/index'
  import { mapGetters } from 'vuex'
  export default {
    computed: {
      ...mapGetters({
        person_info: 'person_info',
        organize_info: 'organize_info'
      })
    },
    methods: {
      origin () {
        return getLocationOrigin()
      }
    },
    watch: {
      person_info (value) {
        if (value.authStatus === 0) {
          this.autorizeType = value.authType
          // 组织认证
          if (value.accpOrgList.length === 0) {
            this.$store.dispatch('organize_info')
            if (this.organize_info.authStatus === 4) {
              location.href = this.origin() + '/attestation/user'
            }
          }
        }
      },
      organize_info (value) {
        if (value.authStatus === 4 && this.person_info.accpOrgList.length === 0) {
          location.href = this.origin() + '/attestation/user'
        } else if (value.authStatus === 1) { // 认证审核中
          // this.$router.push('/organize/commit')
          location.href = this.origin() + '/attestation/user'
        } else if (value.authStatus === 2) { // 认证未通过
          // this.$router.push('/organize/commit')
          location.href = this.origin() + '/attestation/user'
        }
      }
    }
  }
</script>

<style lang="scss">
   
   .welcome{
      h2{
        font-size:20px;
        padding:50px 60px;
      }
   }
</style>
